xenconsole: Ensure exclusive access to console using locks
authorMartin Lucina <martin@lucina.net>
Fri, 24 Jul 2015 15:29:41 +0000 (17:29 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 27 Jul 2015 13:54:55 +0000 (14:54 +0100)
commit8398ec706ff60e17a5044470fa2e90a1b081f37a
treeb4809f504b4bf7c73585c6ababb0a281643c6e13
parent20960a081ad23e0a5d1fd48fd84cff9f81e7cc6c
xenconsole: Ensure exclusive access to console using locks

If more than one instance of xenconsole is run against the same DOMID
then each instance will only get some data. This change ensures
exclusive access to the console by obtaining an exclusive lock on
<XEN_LOCK_DIR>/xenconsole.<DOMID>.

The locking strategy used is based on
tools/libxl/libxl_internal.c:libxl__lock_domain_userdata().

Signed-off-by: Martin Lucina <martin@lucina.net>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
.gitignore
tools/console/Makefile
tools/console/client/main.c